import {Application} from 'egg';

export default (app: Application) => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;
    const businessInfoSchema = new Schema({
        name: {type: String, required: true, unique: true},
        avatar: {type: String},
        phone: {type: String},
        introduction: {type: String},
        discount: {type: String},
        address: {type: String},
        weight: {type: Number, default: 0},
        cate: {type: Schema.Types.ObjectId, ref: 'businessCate'},
        createDate: {type: Date},
        upadeDate: {type: Date},
    });
    return mongoose.model('BusinessInfo', businessInfoSchema);
};
